package com.weilive.platform.dao.app;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.weilive.platform.dao.app.mapper.AppChannelDO;
import com.weilive.platform.dao.app.mapper.AppClientDO;
import com.weilive.platform.dao.app.mapper.AppClusterDO;
import com.weilive.platform.dao.app.mapper.AppInfoDO;
import com.weilive.platform.dao.app.mapper.AppNoticeDO;

@Repository
public interface PlatformAppDAO {

	@Select("select * from app_info")
	@ResultMap("com.weilive.platform.dao.app.mapper.AppInfoMap")
	public List<AppInfoDO> getAllAppInfo();

	@Select("select * from app_client where app_id = #{app_id}")
	@ResultMap("com.weilive.platform.dao.app.mapper.AppClientMap")
	public List<AppClientDO> getAllAppClient(@Param("app_id") int app_id);

	@Select("select * from app_channel where app_id = #{app_id}")
	@ResultMap("com.weilive.platform.dao.app.mapper.AppChannelMap")
	public List<AppChannelDO> getAllAppChannel(@Param("app_id") int app_id);

	@Select("select * from app_cluster where app_id = #{app_id}")
	@ResultMap("com.weilive.platform.dao.app.mapper.AppClusterMap")
	public List<AppClusterDO> getAllAppCluster(@Param("app_id") int app_id);

	@Select("select * from app_notice where app_id = #{app_id} and cluster_id = #{cluster_id} limit 1")
	@ResultMap("com.weilive.platform.dao.app.mapper.AppNoticeMap")
	public AppNoticeDO getAllAppNotice(@Param("app_id") int app_id, @Param("cluster_id") int cluster_id);
}
